package com.cjkj.equipment.mapper;

import com.cjkj.equipment.domain.SmartBraceletData;
import com.cjkj.system.api.domain.request.BraceletHistoryDataReq;
import com.cjkj.system.api.domain.request.EquipmentHDAReq;
import com.cjkj.system.api.domain.request.PatientEquipmentRTDReq;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 手环数据Mapper接口
 * 
 * @author cjkj
 * @date 2024-08-30
 */
public interface SmartBraceletDataMapper
{
    /**
     * 新增手环数据
     *
     * @param smartBraceletData 手环数据
     * @return 结果
     */
    int insertSmartBraceletData(SmartBraceletData smartBraceletData);

    List<SmartBraceletData> listData(@Param("equipmentNo") String equipmentNo,
                                     @Param("startTime") Date startTime,
                                     @Param("endTime") Date endTime);

    List<SmartBraceletData> listDataBefore(@Param("equipmentNo") String equipmentNo,
                                           @Param("startTime") Date startTime,
                                           @Param("endTime") Date endTime);

    List<SmartBraceletData> appListData(EquipmentHDAReq req);

    List<SmartBraceletData> selectBraceletHistoryData(BraceletHistoryDataReq req);

    SmartBraceletData getLastData(PatientEquipmentRTDReq req);

    /**
     * 查询连续数据（用于判断预警信息）
     */
    List<SmartBraceletData> continuousDatas(@Param("equipmentNo") String equipmentNo,
                                            @Param("useStartTime") Date useStartTime,
                                            @Param("acquisitionTime") Date acquisitionTime,
                                            @Param("total") int total);

}
